USE [xRepair]
GO
IF OBJECT_ID('[dbo].[UpdateCity]') IS NOT NULL
BEGIN
DROP PROCEDURE [dbo].[UpdateCity]
END
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[UpdateCity]
		@ID						INT
		,@StateID				INT	
		,@CityName				NVARCHAR(255)	
		,@LastUpdatedAt			DATETIME = NULL
		,@LastUpdatedBy			NVARCHAR(50) = NULL
		,@Rowcount				INT = -1 OUTPUT
AS
BEGIN

	SET NOCOUNT ON;

	UPDATE [dbo].[Cities]
	SET [StateID]			=	@StateID
		,[CityName]			=	@CityName		
		,[LastUpdatedAt]	=	@LastUpdatedAt
		,[LastUpdatedBy]	=	@LastUpdatedBy
	WHERE [ID] = @ID

    SELECT @Rowcount = @@ROWCOUNT
END

GO


